from pydoc import browse

from playwright.sync_api import sync_playwright
from time import sleep
import time
def test_jx_01():
    print('开始')
    with sync_playwright() as playwright:
        browser = playwright.firefox.launch(headless=False)
        page = browser.new_page()
        page.goto('https://www.jiuxian.com/')
        page.click('xpath=/html/body/div[2]/div/div[1]/div/a[1]')
        sleep(3)
        dy1=page.text_content('xpath=//*[@id="loginform"]/div/div/div/div/div[1]/div[1]/a[1]')
        print(dy1)
        assert dy1 == '帐号登录'
        #输入用户名密码
        page.fill('xpath=//*[@id="userName"]','18615488780')
        page.fill('xpath=//*[@id="password"]','lr123456.')
        sleep(15)
        page.click('xpath=//*[@id="save"]')
        page.click('xpath=//*[@id="bindSub"]')
        sleep(3)
        page.fill('xpath=//*[@id="wd"]','五粮液')
        page.click('xpath=/html/body/div[4]/div/div[2]/div[1]/form/input[2]')


        dy3 = page.text_content('xpath=/html/body/div[6]/div/div[2]/div[5]/ul/li[1]/div[2]/div[3]/a')
        print(dy3)

    print('结束')